<?php

/*

Cheat (cheat.pro.php)

*/
ob_start();
$code = explode(", ",$command[1]);
$check = count($code);

if ($check == 1)
{
	/*
	Basic cheats will go here
	*/
}
else
{
	if ($code[0] == "code")
	{
		if ($code[1] == "number8")
		{
			die("Code block 8 is 89vsli");
		}
	}

	if ($code[0] == "random")
	{
		$random = fetch("SELECT * FROM randomnumbergame2 WHERE user = '$userid' AND game = '$game'");
		if (!$random[user])
		{
			die(header(error("random.php?game=$game","Try playing once before you cheat.")));
		}
		if ($random[cheat] == $datestamp)
		{
			die(header(error("random.php?game=$game","You can only cheat once a day in this game.")));
		}
		if ($code[1] == "seventy-three")
		{
			die(header(error("random.php?game=$game&act=play&guess=73&number=73&code=$random[code]","You think you're so clever, don't you?")));
		}
		if ($code[1] == "try my luck")
		{
			die(header(error("random.php?game=$game&act=play&guess=50&prize=500&code=$random[code]","Do you feel lucky, punk?")));
		}
		else
		{
			die(header(error("random.php?game=$game","That isn't a real cheat.")));
		}
	}
	if ($code[0] == "wild")
	{
		$wild = fetch("SELECT * FROM search_pets2 WHERE userid = '$userid' AND game = '$game'");
		if (!$wild[userid])
		{
			die(header(error("search_for_pets.php?game=$game","You can't cheat unless you're playing.")));
		}
		if ($code[1] == "let me cheat again")
		{
			if ($points >= 50)
			{
				mysql_query("UPDATE search_pets2 SET cheat = '0' WHERE userid = '$userid' AND game = '$game'");
				points($game,$username,"-50");
				die(header(error("searching_for_pets.php?game=$game","You cheater. Fifty $pointsVar have been charged to your account.")));
			}
			else
			{
				die(header(error("searching_for_pets.php?game=$game","Cheaters never prosper.")));
			}
		}
		if ($wild[cheat] == 1)
		{
			die(header(error("searching_for_pets.php?game=$game","You can only cheat once per visit.")));
		}
		if ($code[1] == "refill electric nets")
		{
			mysql_query("UPDATE search_pets2 SET elec_nets = '5' WHERE userid = '$userid' AND game = '$game'");
			mysql_query("UPDATE search_pets2 SET cheat = '1' WHERE userid = '$userid' AND game = '$game'");
			die(header(error("searching_for_pets.php?game=$game","Your electric nets have been refilled.")));
		}
		if ($code[1] == "refill magic nets")
		{
			mysql_query("UPDATE search_pets2 SET magic_nets = '5' WHERE userid = '$userid' AND game = '$game'");
			mysql_query("UPDATE search_pets2 SET cheat = '1' WHERE userid = '$userid' AND game = '$game'");
			die(header(error("searching_for_pets.php?game=$game","Your magic nets have been refilled.")));
		}
		if ($code[1] == "refill nets")
		{
			mysql_query("UPDATE search_pets2 SET basic_nets = '10' WHERE userid = '$userid' AND game = '$game'");
			mysql_query("UPDATE search_pets2 SET cheat = '1' WHERE userid = '$userid' AND game = '$game'");
			die(header(error("searching_for_pets.php?game=$game","Your basic nets have been refilled.")));
		}
		if ($code[1] == "i need more time")
		{
			$moves_left = $wild[moves_left] + 25;
			mysql_query("UPDATE search_pets2 SET moves_left = '$moves_left' WHERE userid = '$userid' AND game = '$game'");
			mysql_query("UPDATE search_pets2 SET cheat = '1' WHERE userid = '$userid' AND game = '$game'");
			die(header(error("searching_for_pets.php?game=$game","You can have a little more time.")));
		}
		if ($code[1] == "please let me catch it")
		{
			if (($wild[found] == "pet") or ($wild[found] == "pet2"))
			{
				mysql_query("UPDATE search_pets2 SET found = 'caught_pet' WHERE userid = '$userid' AND game = '$game'");
				mysql_query("UPDATE search_pets2 SET cheat = '1' WHERE userid = '$userid' AND game = '$game'");
				die(header(error("searching_for_pets.php?game=$game","Oh, alright.")));
			}
			else
			{
				die(header(error("searching_for_pets.php?game=$game","What are you trying to catch?")));
			}
		}
		if ($code[1] == "show me a foxly")
		{
			$level = rand(1,6);
			mysql_query("UPDATE search_pets2 SET found = 'pet' WHERE userid = '$userid' AND game = '$game'");
			mysql_query("UPDATE search_pets2 SET found_what = '13' WHERE userid = '$userid' AND game = '$game'");
			mysql_query("UPDATE search_pets2 SET found_what2 = '$level' WHERE userid = '$userid' AND game = '$game'");
			mysql_query("UPDATE search_pets2 SET cheat = '1' WHERE userid = '$userid' AND game = '$game'");
			die(header(error("searching_for_pets.php?game=$game","Here she is.")));
		}
		if ($code[1] == "show me something different")
		{
			$pet = rand(1,2);
			$level = rand(1,6);
			mysql_query("UPDATE search_pets2 SET found = 'pet' WHERE userid = '$userid' AND game = '$game'");
			mysql_query("UPDATE search_pets2 SET found_what = '$pet' WHERE userid = '$userid' AND game = '$game'");
			mysql_query("UPDATE search_pets2 SET found_what2 = '$level' WHERE userid = '$userid' AND game = '$game'");
			mysql_query("UPDATE search_pets2 SET cheat = '1' WHERE userid = '$userid' AND game = '$game'");
			die(header(error("searching_for_pets.php?game=$game","Surprise!")));
		}
		else
		{
			die(header(error("searching_for_pets.php?game=$game","That isn't a code.")));
		}
	}
}

?>